<?php /* Smarty version 2.6.25, created on 2012-10-05 16:56:59
         compiled from tpl/preview.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'upper', 'tpl/preview.html', 11, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "tpl/header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?> 
		  	<div id='separa_pagina_header'></div>
		  	<div id='header_preview'></div>
		  	<div id='centro_preview'>
				<div id='detalle_aviso'>
					<div id='nombre_empresa'>
						<table width='100%' cellpadding=0 cellspacing=0 border=0>
							<tr>
								<td width='160'><img src='<?php echo $this->_tpl_vars['imagenes'][0]; ?>
' style='width:160px;height:100px;'></td>
								<td valign='top'>
									<div class='titulo_aviso'><?php echo ((is_array($_tmp=$this->_tpl_vars['registro']->empresa)) ? $this->_run_mod_handler('upper', true, $_tmp) : smarty_modifier_upper($_tmp)); ?>
</div>
									<div class='descripcion_aviso'><?php echo $this->_tpl_vars['registro']->descripcion_corta; ?>
</div>
								</td>
							</tr>
						</table>
					</div>

					<div class='calle_horizontal_10'>&nbsp;</div>
					<div id='imagenes_aviso'>
						<?php $_from = $this->_tpl_vars['imagenes']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['imagen']):
?>
							<?php if ($this->_tpl_vars['key'] != 0): ?>	
							<img src='<?php echo $this->_tpl_vars['imagen']; ?>
' width='160' height='100' > 
							<?php endif; ?>
						<?php endforeach; endif; unset($_from); ?>
					</div>
					<div class='calle_horizontal_10'>&nbsp;</div>
					<div class='titulo_contacto'>CONTACTO</div>
					<table width='100%' cellpadding='0' cellspacing='0' border='0' style='background-color:#ebebeb;border-left: 1px solid #d0d0d0;border-right: 1px solid #d0d0d0; border-bottom:1px solid #d0d0d0;'> 
						<tr>
							<td align='left' width='550' style='padding-left: 13px; padding-top: 5px;padding-bottom:5px'>
								TEL&Eacute;FONO: <?php echo $this->_tpl_vars['registro']->telefonos; ?>
 <br>
								DIRECCI&Oacute;N: <?php echo $this->_tpl_vars['registro']->direccion; ?>
<br>
								HORARIO DE ATENCI&Oacute;N: <?php echo $this->_tpl_vars['registro']->horario_atencion; ?>
<br>
								P&Aacute;GINA WEB: <a href='<?php echo $this->_tpl_vars['registro']->website; ?>
' target='_blank'><?php echo $this->_tpl_vars['registro']->website; ?>
</a><br>
							</td>
							<td align='right' valign='top' style='padding-top:5px;padding-right:15px;padding-bottom:20px'>
								AGREGAR A CONSULTA<BR><br> 
								<input type='checkbox' checked='true'> SELECCIONAR
								<br><br>
								<img src='imagenes/boton_volver.jpg' width='70' height='17'>

							</td>
						</tr>
						<tr>
							<td colspan='2' style='border-top: 1px solid #d0d0d0;' >
								<div style='text-align:left;padding-left: 13px;'>
									<p class='secciones_aviso'>NOSOTROS:</p>
									<p><?php echo $this->_tpl_vars['registro']->descripcion; ?>
</p>
									<p class='secciones_aviso'>CLIENTES:</p>
									<p><?php echo $this->_tpl_vars['registro']->clientes; ?>
</p>
									<p class='secciones_aviso'>SERVICIOS:</p>
									<p>
										<?php $_from = $this->_tpl_vars['categorias']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['categoria_id'] => $this->_tpl_vars['dato']):
?>
											<p><?php echo $this->_tpl_vars['dato']['nombre']; ?>
:
												<ul>
												<?php $_from = $this->_tpl_vars['dato']['subcategorias']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['nombre']):
?>
													<li><?php echo $this->_tpl_vars['nombre']; ?>
</li> 
												<?php endforeach; endif; unset($_from); ?>
												</ul>
											</p>
										<?php endforeach; endif; unset($_from); ?>
									</p>

								</div>
							</td>
						</tr>
					</table>

				</div>
				<div style='height:25px;'><a href='editar.php?id_registro=<?php echo $this->_tpl_vars['registro']->id_registro; ?>
'>Editar informaci&oacute;n</a></div>
			</div>
			
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "tpl/footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?> 
<script type="text/javascript">
    $(document).ready(function() {
		/**
		* Zonas
		*/
		$(".zonas_todas").click(function(){
            $('.zona').each(function(){
                zona_id = "zona_" +  $(this).attr('value') 
                $("#" + zona_id).prop('checked',true); 
            })
            
        });

		$(".zonas_ninguna").click(function(){
            $('.zona').each(function(){
                zona_id = "zona_" +  $(this).attr('value') 
                $("#" + zona_id).prop('checked',false); 
            })
            
        });

        $("div.opc_todas ").click(function(){
            cat = $(".opc_todas a ").attr('id') 
            alert('cat')
        })
        
        $('.categorias').click(function(){
            cat = $(this).attr('id') 
            //alert(cat);
            if($(this).is(':checked') ){
                $('#sub' + cat).css('display','block');
            }else{
                $('#sub' + cat).css('display','none');
            }
            /**
             * mostrar subcategorias
             */
        });
        
        /**
         * Seleccionar todas
         */
        $(".opc_todas").click(function(){
            cat = $(this).attr('valor')
            $('#subcat_' + cat + " input ").each(function(){
                subcategoria = "subcategoria_" +  $(this).attr('value') 
                $("#" + subcategoria).prop('checked',true); 
            })
            
        });
        
        /**
         * Deseleccionar
         */
        $(".opc_ninguna").click(function(){
            cat = $(this).attr('valor')
            $('#subcat_' + cat + " input ").each(function(){
                subcategoria = "subcategoria_" +  $(this).attr('value') 
                $("#" + subcategoria).prop('checked',false); 
            })
            
        });
        
    })
</script>        